package com.njwb.day16.dom.Class;

public class People {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age >= 0 && age <= 100) {
            this.age = age;
        } else {
            throw new IllegalArgumentException("年龄必须在0到100之间！");
        }
    }
}
